#ifndef _ROUTE_H_
#define _ROUTE_H_

#include "common/common.h"
#include "json/json-usr.h"

namespace iecas_ns
{
    class CRoute
    {
		public:
			static shared_ptr<CRoute> getInstance();
            CRoute();
			bool init(void);
            void start(void);
            void loop(void);
            void addSingleRoute(Value singleRoute);
            void delSingleRoute(Value singleRoute);
            bool getSingleRoute(string srcDev, vector<string> &destDevAll);
            void getAllRoute(Value &allRoute);
		private:
			static shared_ptr<CRoute> sm_intancePtr;
            shared_ptr<CCommon> m_commonPtr;
            shared_ptr<CJsonUsr> m_jsonUsrPtr;
            mutex m_src_dest_Lock;
            Value m_src_dest_route;
            bool readRouteFile(void);
            bool writeRouteFile(void);
    };
}

#endif